<?php if (!defined('BASEPATH'))exit('No direct script access allowed');
/**
 * 公告控制器
 */
class Notice extends MY_Controller {

    function __construct() {
        parent::__construct();
    }
    //公告详情页
    function detail() {
        $id = isset($_REQUEST['id']) ? trim($_REQUEST['id']) : 0;
        if(!$id){
            $this->display('deleted/index.html');exit;
        }
        $item = $this->db->query("select title,content,create_time from tan_content where id = $id and status = 1 order by id desc limit 1")->row_array();
        if(!$item){
            $this->display('deleted/index.html');exit;
        }
//        $item['content'] = str_replace(" ", "", $item['content']);
        $item['create_time'] = date("Y-m-d H:i:s",$item['create_time']);
        $this->assign("item", $item);
        $this->display('notice/detail.html');
    }
}
